bail out if there is no need for scrolling (more obvious than adding
authorMichael Natterer <mitch@imendio.com>
Mon, 27 Mar 2006 17:00:01 +0000 (17:00 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Mon, 27 Mar 2006 17:00:01 +0000 (17:00 +0000)
2006-03-27  Michael Natterer  <mitch@imendio.com>

* gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need
for scrolling (more obvious than adding additional conditions to
the scroll offset calculation). Fixes bug #335912.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkmenu.c

index c6f4d9e1fb4e353cf8abd389a0b1c630074dde13..fd9e4cc5c2ebb9b6441513a4cf171a476adaa6c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-27  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need
+       for scrolling (more obvious than adding additional conditions to
+       the scroll offset calculation). Fixes bug #335912.
+
 2006-03-27  Anders Carlsson  <andersca@imendio.com>
 
         * gtk/Makefile.am:
index c6f4d9e1fb4e353cf8abd389a0b1c630074dde13..fd9e4cc5c2ebb9b6441513a4cf171a476adaa6c4 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-27  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need
+       for scrolling (more obvious than adding additional conditions to
+       the scroll offset calculation). Fixes bug #335912.
+
 2006-03-27  Anders Carlsson  <andersca@imendio.com>
 
         * gtk/Makefile.am:
index cdba77ba7bf7001527a95dc1e2874e176ffae959..a31a67068446cb490c17cd42efa3fc914bd8a8d2 100644 (file)
@@ -2983,6 +2983,10 @@ gtk_menu_scroll_by (GtkMenu *menu,
 
   gdk_drawable_get_size (widget->window, &view_width, &view_height);
 
+  if (menu->scroll_offset == 0 &&
+      view_height >= widget->requisition.height)
+    return;
+
   /* Don't scroll past the bottom if we weren't before: */
   if (menu->scroll_offset > 0)
     view_height -= MENU_SCROLL_ARROW_HEIGHT;